<?php
    include "admin_users.php";

$id=$_REQUEST['id'];

$oldmoney=$_REQUEST['oldmoney'];
$money=$_REQUEST['money']+$oldmoney;
// var_dump($id);

mysqli_select_db($conn,"shopping");

   $sql = "update users set money='$money' where id='$id'";  //SQL模板

   $result=mysqli_query($conn,$sql);

    if (!$result){
        echo '金额更新失败！';
    }else{
        echo '金额更新成功！';
    }
    
    mysqli_close($conn);
?>
